<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>箭头函数的this指向</title>
</head>
<body>
    <script>
        const obj = {
            func1() {
                setTimeout(function() {
                    console.log(this);
                })
            },
            func2() {
                setTimeout(() => {
                    console.log(this);
                })
            }
        }
        obj.func1(); // 打印出 Window
        obj.func2(); // 打印出 当前对象
    </script>
</body>
</html>